package co.com.inventarios.modelo;

import java.sql.Timestamp;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Prounimed entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "PROUNIMED", schema = "MANAGER", uniqueConstraints = {})
public class Prounimed implements java.io.Serializable {

	// Fields

	private ProunimedId id;
	private Producto producto;
	private Unimed unimed;
	private Double pumfactor;
	private Timestamp pumlogfec;
	private Dlluser dlluser;
	// Constructors

	/** default constructor */
	public Prounimed() {
	}

	/** full constructor */
	public Prounimed(ProunimedId id, Producto producto, Unimed unimed,
			Dlluser dlluser,Timestamp pumlogfec,
			Double pumfactor) {
		this.id = id;
		this.producto = producto;
		this.pumlogfec = pumlogfec;
		this.dlluser = dlluser;
		this.unimed = unimed;
		this.pumfactor = pumfactor;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "pumproduct", column = @Column(name = "PUMPRODUCT", unique = false, nullable = false, insertable = true, updatable = true, length = 15)),
			@AttributeOverride(name = "pumunimed", column = @Column(name = "PUMUNIMED", unique = false, nullable = false, insertable = true, updatable = true, length = 4)) })
	public ProunimedId getId() {
		return this.id;
	}

	public void setId(ProunimedId id) {
		this.id = id;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "PUMPRODUCT", unique = false, nullable = false, insertable = false, updatable = false)
	public Producto getProducto() {
		return this.producto;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "PUMLOGUSER", unique = false, nullable = true, insertable = true, updatable = true)
	public Dlluser getDlluser() {
		return this.dlluser;
	}

	public void setDlluser(Dlluser dlluser) {
		this.dlluser = dlluser;
	}

	@Column(name = "PUMLOGFEC", unique = false, nullable = true, insertable = true, updatable = true)
	public Timestamp getPumlogfec() {
		return this.pumlogfec;
	}

	public void setPumlogfec(Timestamp pumlogfec) {
		this.pumlogfec = pumlogfec;
	}
	
	public void setProducto(Producto producto) {
		this.producto = producto;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "PUMUNIMED", unique = false, nullable = false, insertable = false, updatable = false)
	public Unimed getUnimed() {
		return this.unimed;
	}

	public void setUnimed(Unimed unimed) {
		this.unimed = unimed;
	}

	@Column(name = "PUMFACTOR", unique = false, nullable = false, insertable = true, updatable = true, precision = 10, scale = 3)
	public Double getPumfactor() {
		return this.pumfactor;
	}

	public void setPumfactor(Double pumfactor) {
		this.pumfactor = pumfactor;
	}

}